// Learn TypeScript:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html

const {ccclass, property} = cc._decorator;

@ccclass
export default class Crazy8Loading extends cc.Component {

    @property(cc.ProgressBar)
    bar: cc.ProgressBar = null;
    @property(cc.Node)
    btn: cc.Node = null;
    

    // LIFE-CYCLE CALLBACKS:

    // onLoad () {}

    start () {
        cc.tween(this.bar)
            .to(3, {progress: 1},{easing: 'backIn'})
            .call(() => {
              this.btn.active = true;
            })
            .start();
    }


    enterGame() {
        cc.director.loadScene('crazy8');
    }

    // update (dt) {}
}
